package com.gk.panda.apis.enums;

/**
 * @description: 事件类型枚举
 * @date: 2022/10/25 17:48
 **/
public enum EventFlowRecordStatusEnum {

    TO_BE_VIEWED(0,"待查看"),
    ACCEPTANCE(1,"受理"),
    PROCESSING(2,"处理中"),
    DELIVER(3,"转交"),
    PROCESSING_COMPLETED(4,"处理完成"),
    ;


    private final Integer code;
    private final String desc;


    EventFlowRecordStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 根据code获取值
     * @param code
     * @return
     */
    public static String getDescByCode(Integer code) {
        EventFlowRecordStatusEnum[] values = EventFlowRecordStatusEnum.values();
        for (EventFlowRecordStatusEnum tmp : values){
            if (tmp.getCode().equals(code)){
                return tmp.getDesc();
            }
        }
        return null;
    }
}
